#include <opencv2/opencv.hpp>
#include <opencv2/dnn.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>

using namespace cv; //Must Need Write cv
using namespace std;

/*
 * ./opencv_at_demo1 <image1>
 *
 */

int main(int argc, char** argv)
{
    Mat img_mat = imread(argv[1]); //读取图片
    for (int i = 0; i < img_mat.rows; i++) //循环遍历rows
    {
        for (int j = 0; j < img_mat.cols; j++) //循环遍历cols
        {
            img_mat.at<Vec3b>(i,j)[0] = (int)img_mat.at<Vec3b>(i,j)[0] - 10;  //对第一个通道进行像素处理
            img_mat.at<Vec3b>(i,j)[1] = (int)img_mat.at<Vec3b>(i,j)[1] - 50;  //对第二个通道进行像素处理
            img_mat.at<Vec3b>(i,j)[2] = (int)img_mat.at<Vec3b>(i,j)[2] - 10;  //对第三个通道进行像素处理
        }
    }
    imwrite("at_Vec3b.jpg", img_mat);

    return 0;
}


